package com.mzj.saas.mservice.announcement.repository;

import com.mzj.saas.mservice.announcement.entity.Announcement;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface AnnouncementRepository extends PagingAndSortingRepository<Announcement, Long>, JpaSpecificationExecutor<Announcement> {
    List<Announcement> findByOrgIdAndTypeOrderByReleaseTimeDesc(Long orgId, Integer type);

    List<Announcement> findByTypeAndStatus(Integer type, Integer status);

    List<Announcement> findByTypeAndAreaIdAndStatus(Integer type, Long areaId, Integer status);

    List<Announcement> findByTypeAndCommunityIdAndStatus(Integer type, String communityId, Integer status);
    List<Announcement> findByCommunityIdAndStatus(String communityId, Integer status);

    List<Announcement> findByCommunityId(String communityId);

}
